Greenhouse gases in Earth's atmosphere such as carbon dioxide, methane, and water vapor absorb energy which cause a blanketing effect that warms the earth.
2.
The blanketing effect is thus highly dependent on the metallicity index of a star, which indicates the fraction of elements other than hydrogen and helium that compose it.